<script setup lang='ts'>
import { useGetReason } from '@fl/api/supplier'

const rejectVisible = defineModel<boolean>('rejectVisible', { required: true })
const id = defineModel<string>('id', { required: true })

const params = computed(() => {
    return {
        id: id.value,
        rejectVisible: unref(rejectVisible),
    }
})

console.log('params', params)
const { data: reason, isLoading } = useGetReason(params)
function onCancelBtnClick() {
    rejectVisible.value = false
}
</script>

<template>
    <PlusDialog v-model="rejectVisible"
                title="驳回原因"
                width="700"
                close-on-press-escape
    >
        <div class="mb-50">
            {{ reason || '暂无数据' }}
        </div>

        <template #footer>
            <div class="mx-auto">
                <el-button v-loading="isLoading"
                           type="primary"
                           @click="onCancelBtnClick"
                >
                    确定
                </el-button>
            </div>
        </template>
    </PlusDialog>
</template>
